{	Problem: http://codeforces.ru/problemset/problem/106/B
	Verdict: Accepted
}
uses
        SysUtils, Math;

type
        al = array[1..5] of longint;

var
        i, j, n : longint;
        a : array[0..110] of al;
        f : boolean;

procedure sort(l, r : longint);

var
        i, j, x: longint;
        y : al;

begin
        i := l;
        j := r;
        x := a[(l + r) shr 1][4];
        repeat
                while a[i][4] < x do inc(i);
                while a[j][4] > x do dec(j);
                if i <= j then begin
                        y := a[i];
                        a[i] := a[j];
                        a[j] := y;
                        inc(i);
                        dec(j);
                end;
        until i > j;
        if l < j then sort(l, j);
        if i < r then sort(i, r);
end;
                
begin 
        read(n);
        for i := 1 to n do begin
                read(a[i][1], a[i][2], a[i][3], a[i][4]);
                a[i][5] := i;
        end;
        sort(1, n);
        for i := 1 to n do begin
                f := true;
                for j := 1 to n do begin
                        if i = j then continue;
                        if (a[j][1] > a[i][1]) and (a[j][2] > a[i][2]) and (a[j][3] > a[i][3]) then begin
                                f := false;
                                break;
                        end;
                end;
                if f then begin
                        write(a[i][5]);
                        halt(0);
                end;
        end;
end.